﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="FindCar.aspx.cs" Inherits="DentScan2.WebApp.FindCar" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h1>Търсене на автомобил</h1>
    <asp:RadioButtonList runat="server" ID="rblSearchWhere">
        <asp:ListItem Text="Номер на експертиза" Value="0" Selected="True" />
        <asp:ListItem Text="Рег. номер(САМО ГЛАВНИ БУКВИ)" Value="1" />
        <asp:ListItem Text="Рама" Value="2" />
    </asp:RadioButtonList>
    <asp:TextBox runat="server" ID="tbSS" CssClass="inputNormal" />
    <asp:FilteredTextBoxExtender ID="fteRegNumber" runat="server" TargetControlID="tbSS" FilterMode="ValidChars" FilterType="Custom" ValidChars="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"></asp:FilteredTextBoxExtender>
    <asp:Button runat="server" ID="bFind" Text=">>" OnClick="bFind_Click" />
    <asp:Label runat="server" ID="lblNotFound" Text="Автомобилът не е намерен" Visible="false" ForeColor="Red" />
    <a href="SelectMethod.aspx?NewDamage=1">Нова щета</a><br />
            <asp:Label runat="server" ID="lRecordCount" Text="0" />
            &nbsp;открити записа

    
    <asp:Repeater runat="server" ID="rResults">
        <HeaderTemplate>
            <table border="1" cellpadding="0" cellspacing="0">
                <tr>                
                    <td>
                        <p class="lbl">Марка </p>
                    </td>
                    <td>
                        <p class="lbl">Модел</p>
                    </td>
                    <td>
                        <p class="lbl">Рег. Номер</p>
                    </td>
                    <td>
                        <p class="lbl">Собственик</p>
                    </td>
                    <td>
                        <p class="lbl">Стойност на щетата</p>
                    </td>
                    <td>
                        <p class="lbl">Дата на оценка</p>
                    </td>
                </tr>
        </HeaderTemplate>
        <ItemTemplate>
            <tr>
                <td>
                    <a href='Default.aspx?DamageId=<%#Eval("DamageId") %>'>
                        <%#Eval("MakeName") %>
                    </a>
                    <br />
                    <a href='SelectMethod.aspx?CarId=<%#Eval("CarId") %>'>Нова щета на този собственик и автомобил
                    </a>
                    <br />
                    <a href='SelectMethod.aspx?OwnerId=<%#Eval("OwnerId") %>'>Нова щета на този собственик
                    </a>

                </td>
                <td>
                    <%#Eval("ModelName") %>
                </td>
                <td>
                    <%#Eval("RegNumber") %>
                </td>
                <td>
                    <%#Eval("Name") %>
                </td>
                <td>
                    <%#Eval("Total") %>
                </td>
                <td>
                    <%#Eval("ExpertiseDate")!=null?DateTime.Parse(Eval("ExpertiseDate").ToString()).ToShortDateString():"" %>
                </td>
            </tr>
        </ItemTemplate>
        <FooterTemplate>
            </table>
        </FooterTemplate>

    </asp:Repeater>
</asp:Content>
